<template>
  <div>
    <ul
      v-for="(item, index) in routerData.slice(2, routerData.length)"
      :index="item + index"
      :key="item"
    >
      <!-- <li @click="routerPath(item.path)">
        {{ item.path }}
      </li> -->
      <router-link :to="item.path"> {{ item.path }}</router-link>
    </ul>
  </div>
</template>

<script setup lang='ts'>
import { ref, reactive } from "vue";
import { useRoute, useRouter } from "vue-router";

const route = useRoute();
const router = useRouter();
// 获取路由数据
const routerData = reactive(router.options.routes);

const routerPath = (item) => {
  router.push(item);
};
</script>

<style scoped>
</style>